package liuyao.webutils.utils;

public class BinUtil {

    // 转为 无符号int
    public static long toUnsignedInt(byte n1, byte n2, byte n3, byte n4)    {
        return (((long) toUbyte(n4)) << 24)
                | (((long) toUbyte(n3)) << 16)
                | (((long) toUbyte(n2)) << 8)
                | ((long) toUbyte(n1));
    }

    // 转为无符号 byte
    public static int toUbyte(byte n) {
        return (int)n & 0xff;
    }
}
